import { Module } from 'vuex'
import { AllStateTypes } from '../../types'
import StoreDataTypes from './types'
const storeModule: Module<StoreDataTypes, AllStateTypes> = {
  namespaced: true,
  state: {
    activekey: 0,
    isReload: false, // 是否重新加载
    infosHeaderData: null,
    scId: '',
  },
  mutations: {
    SET_ACTIVEKEY: (state: StoreDataTypes, data: number) => {
      state.activekey = data
    },
    SET_ISRELOAD: (state: StoreDataTypes, data: boolean) => {
      state.isReload = data
    },
    SET_INFOSHEADERDATA: (state: StoreDataTypes, data: boolean) => {
      state.infosHeaderData = data
    },
    SET_SCID: (state: StoreDataTypes, data: string) => {
      state.scId = data
    },
  },
  getters: {
    isReload: (state) => state.isReload,
    infosHeaderData: (state) => state.infosHeaderData,
    scId: (state) => state.scId,
  },
  actions: {},
}
export default storeModule
